<?php
	class PlatosController extends AppController
	{
		var $name= 'Platos';
		var $uses= array('Producto','Tipo');
		var $helpers = array('Html', 'Form', 'Javascript');
		var $components = array('RequestHandler');
	
		function index()
		{
				$this->set('tipos', $this->Tipo->findAll());
		}
		
		function add()
	{
		if ($this->RequestHandler->isAjax()) 
		{ 
			if ($this->Producto->save($this->data)) 
			{ 
				echo 'success'; 
			} 
		  Configure::write('debug', 0); 
		  $this->autoRender = false;
		  exit(); 
		}
	}
	}
?>